home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / gnu / djgpp / src / gas-211 / gas / struc-sy.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-05-30  |  3.9 KB  |  125 lines

  1. /* struct_symbol.h - Internal symbol structure
  2.    Copyright (C) 1987, 1992 Free Software Foundation, Inc.
  3.  
  4.    This file is part of GAS, the GNU Assembler.
  5.  
  6.    GAS is free software; you can redistribute it and/or modify
  7.    it under the terms of the GNU General Public License as published by
  8.    the Free Software Foundation; either version 2, or (at your option)
  9.    any later version.
  10.  
  11.    GAS is distributed in the hope that it will be useful,
  12.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.    GNU General Public License for more details.
  15.  
  16.    oYou should have received a copy of the GNU General Public License
  17.    along with GAS; see the file COPYING.  If not, write to
  18.    the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  19.  
  20. #ifndef __struc_symbol_h__
  21. #define __struc_symbol_h__
  22.  
  23. #ifdef BFD_ASSEMBLER
  24. /* The BFD code wants to walk the list in both directions.  */
  25. #undef  SYMBOLS_NEED_BACKPOINTERS
  26. #define SYMBOLS_NEED_BACKPOINTERS
  27. #endif
  28.  
  29. /* our version of an nlist node */
  30. struct symbol
  31. {
  32. #ifndef BFD_ASSEMBLER
  33.   /* The (4-origin) position of sy_name in the symbol table of the object
  34.      file.  This will be 0 for (nameless) .stabd symbols.
  35.  
  36.      Not used until write_object_file() time. */
  37.   unsigned long sy_name_offset;
  38.  
  39.   /* What we write in .o file (if permitted).  */
  40.   obj_symbol_type sy_symbol;
  41.  
  42.   /* The 24 bit symbol number.  Symbol numbers start at 0 and are unsigned. */
  43.   long sy_number;
  44. #else
  45.   /* BFD symbol */
  46.   asymbol *bsym;
  47. #endif
  48.  
  49.   struct symbol *sy_next;    /* forward chain, or NULL */
  50. #ifdef SYMBOLS_NEED_BACKPOINTERS
  51.   struct symbol *sy_previous;    /* backward chain, or NULL */
  52. #endif /* SYMBOLS_NEED_BACKPOINTERS */
  53.  
  54.   struct frag *sy_frag;        /* NULL or -> frag this symbol attaches to. */
  55.  
  56.   struct symbol *sy_forward;    /* value is really that of this other symbol */
  57.  
  58.   int written : 1;
  59.  
  60. #ifdef TARGET_SYMBOL_FIELDS
  61.   TARGET_SYMBOL_FIELDS
  62. #endif
  63. };
  64.  
  65. typedef struct symbol symbolS;
  66.  
  67. typedef unsigned valueT;    /* The type of n_value. Helps casting. */
  68.  
  69. #ifndef WORKING_DOT_WORD
  70. struct broken_word
  71.   {
  72.     struct broken_word *next_broken_word;    /* One of these strucs per .word x-y */
  73.     fragS *frag;        /* Which frag its in */
  74.     char *word_goes_here;    /* Where in the frag it is */
  75.     fragS *dispfrag;        /* where to add the break */
  76.     symbolS *add;        /* symbol_x */
  77.     symbolS *sub;        /* - symbol_y */
  78.     long addnum;        /* + addnum */
  79.     int added;            /* nasty thing happend yet? */
  80.     /* 1: added and has a long-jump */
  81.     /* 2: added but uses someone elses long-jump */
  82.     struct broken_word *use_jump;    /* points to broken_word with a similar
  83.                      long-jump */
  84.   };
  85. extern struct broken_word *broken_words;
  86. #endif /* ndef WORKING_DOT_WORD */
  87.  
  88. /*
  89.  * Current means for getting from symbols to segments and vice verse.
  90.  * This will change for infinite-segments support (e.g. COFF).
  91.  */
  92. /* #define    SYMBOL_TYPE_TO_SEGMENT(symP)  ( N_TYPE_seg [(int) (symP)->sy_type & N_TYPE] ) */
  93. extern segT N_TYPE_seg[];    /* subseg.c */
  94.  
  95. #define    SEGMENT_TO_SYMBOL_TYPE(seg)  ( seg_N_TYPE [(int) (seg)] )
  96. extern const short seg_N_TYPE[];/* subseg.c */
  97.  
  98. #define    N_REGISTER    30    /* Fake N_TYPE value for SEG_REGISTER */
  99.  
  100. #ifdef SYMBOLS_NEED_BACKPOINTERS
  101.  
  102. void symbol_clear_list_pointers PARAMS ((symbolS * symbolP));
  103. void symbol_insert PARAMS ((symbolS * addme, symbolS * target,
  104.                 symbolS ** rootP, symbolS ** lastP));
  105. void symbol_remove PARAMS ((symbolS * symbolP, symbolS ** rootP,
  106.                 symbolS ** lastP));
  107. void verify_symbol_chain PARAMS ((symbolS * rootP, symbolS * lastP));
  108.  
  109. #define symbol_previous(s) ((s)->sy_previous)
  110.  
  111. #else /* SYMBOLS_NEED_BACKPOINTERS */
  112.  
  113. #define symbol_clear_list_pointers(clearme) {clearme->sy_next = NULL;}
  114.  
  115. #endif /* SYMBOLS_NEED_BACKPOINTERS */
  116.  
  117. void symbol_append PARAMS ((symbolS * addme, symbolS * target,
  118.                 symbolS ** rootP, symbolS ** lastP));
  119.  
  120. #define symbol_next(s)    ((s)->sy_next)
  121.  
  122. #endif /* __struc_symbol_h__ */
  123.  
  124. /* end of struc-symbol.h */
  125.